//
//  GAKKIBaseTextField.h
//  GANGAIKit
//
//  Created by fh on 2019/11/6.
//  Copyright © 2019 cashchina. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GAKKIConfig.h"
@class GAKKIBaseTextField;

NS_ASSUME_NONNULL_BEGIN

typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldFrame) (CGRect frame);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldBackgroundColor) (UIColor * __nullable backgroundColor);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldText) (NSString * __nullable text);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldFont) (UIFont * __nullable font);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldTextColor) (UIColor * __nullable textColor);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldTextAlignment) (NSTextAlignment textAlignment);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldAttributedString) (NSAttributedString * __nullable attributedText);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldBorderStyle) (UITextBorderStyle borderStyle);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldPlaceholder) (NSString * __nullable placeholder);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldAttributedPlaceholder) (NSAttributedString * __nullable attributedPlaceholder);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldClearsOnBeginEditing) (BOOL clearsOnBeginEditing);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldAdjustsFontSizeToFitWidth) (BOOL adjustsFontSizeToFitWidth);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldMinimumFontSize) (CGFloat minimumFontSize);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldDelegate) (id<UITextFieldDelegate> __nullable delegate);
typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldClearButtonMode) (UITextFieldViewMode clearButtonMode);

typedef GAKKIBaseTextField * _Nonnull (^GAKKITextFieldEnabled) (BOOL enabled);

/// 编辑框基类
@interface GAKKIBaseTextField : UITextField

/// 初始化统一样式
+ (instancetype)initGAKKIBaseTextField;

/// 工厂类方法
/// @param block 实例对象
+ (GAKKIBaseTextField *)gakki_makeTextField:(void(^)(GAKKIBaseTextField * textField))block;

/// 尺寸
@property (nonatomic, readonly, copy) GAKKITextFieldFrame gakki_frame;
/// 背景颜色
@property (nonatomic, readonly, copy) GAKKITextFieldBackgroundColor gakki_backgroundColor;
/// 文本
@property (nonatomic, readonly, copy) GAKKITextFieldText gakki_text;
/// 字体
@property (nonatomic, readonly, copy) GAKKITextFieldFont gakki_font;
/// 字体颜色
@property (nonatomic, readonly, copy) GAKKITextFieldTextColor gakki_textColor;
/// 文本对齐方式
@property (nonatomic, readonly, copy) GAKKITextFieldTextAlignment gakki_textAlignment;
/// 富文本
@property (nonatomic, readonly, copy) GAKKITextFieldAttributedString gakki_attributedText;
/// 样式
@property (nonatomic, readonly, copy) GAKKITextFieldBorderStyle gakki_borderStyle;
/// 占位文本
@property (nonatomic, readonly, copy) GAKKITextFieldPlaceholder gakki_placeholder;
/// 富文本占位文本
@property (nonatomic, readonly, copy) GAKKITextFieldAttributedPlaceholder gakki_attributedPlaceholder;

@property (nonatomic, readonly, copy) GAKKITextFieldClearsOnBeginEditing gakki_clearsOnBeginEditing;
/// 是否自适应宽度
@property (nonatomic, readonly, copy) GAKKITextFieldAdjustsFontSizeToFitWidth gakki_adjustsFontSizeToFitWidth;
/// 自适应宽度的情况下最小的字体
@property (nonatomic, readonly, copy) GAKKITextFieldMinimumFontSize gakki_minimumFontSize;
/// 代理
@property (nonatomic, readonly, copy) GAKKITextFieldDelegate gakki_delegate;
/// 清理按钮模式
@property (nonatomic, readonly, copy) GAKKITextFieldClearButtonMode gakki_clearButtonMode;

/// 是否可用
@property (nonatomic, readonly, copy) GAKKITextFieldEnabled gakki_enabled;


@end

NS_ASSUME_NONNULL_END
